package com.efast.dmom.mes.dao.entity;

import java.util.Map;

import org.apache.ibatis.annotations.Select;

import com.efast.dmom.mes.bean.RouteLines;
import com.efast.dmom.mes.dao.base.RouteRelateBaseEntityDao;
import com.efast.dmom.mes.entity.RouteLineEntity;

public interface RouteLinesDao extends RouteRelateBaseEntityDao<RouteLineEntity>{
	
	/**
	 * 往aps_route_lines表中新增一条数据
	 * */
	public void insertRouteLines(RouteLines apsRouteLines);
	
	/**
	 *更新aps_route_lines表中的一条数据
	 * */
	public void updateRouteLines(RouteLines apsRouteLines);
	/**
	 *删除aps_route_lines表中的一条数据
	 * */
	public void deleteRouteLines(Long RouteLinesId);
	
	/**
	 * 新增时校验是否有有重复的
	 * **/
	@Select("select count(1) from aps_route_lines where route_id = #{routeId} and line_id = #{lineId}")
	public int addValidateRepetition(Map<String,Object> map);
	
	/**
	 *更新时校验是否有有重复的
	 * **/
	@Select("select count(1) from aps_route_lines where route_id = #{routeId} and line_id = #{lineId} and route_lines_id != #{routeLinesId}")
	public int updateValidateRepetition(Map<String,Object> map);

}
